home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / basic / PureBasic.lha / PureBasic_Demo / PureBasic / Examples / FullVersion_Sources / Timer.pb < prev    next >
Encoding:
Text File  |  2000-03-19  |  617 b   |  44 lines

  1.  
  2. ; ***********************************
  3. ;
  4. ;  Timer example file for Pure Basic
  5. ;
  6. ;  © 2000 - Fantaisie Software -
  7. ;
  8. ; ***********************************
  9.  
  10.  
  11.  InitTimer()
  12.  
  13.  If AllocateTimer()
  14.  
  15.    PrintN("A timer is allocated.")
  16.  
  17.    StartTimer()
  18.    cal.w=StopTimer()
  19.  
  20.    For b.l=0 To 5
  21.  
  22.      StartTimer()
  23.  
  24.      For c.l=0 To 999    ; } some delay here
  25.      Next c              ; }
  26.  
  27.      time.w=StopTimer()
  28.  
  29.      If time > 0
  30.        time-cal
  31.        PrintNumber(time) : PrintN("")
  32.      Else
  33.        PrintN("Time taken is greater than one frame.")
  34.      EndIf
  35.  
  36.    Next b
  37.  
  38.    FreeTimer()
  39.  EndIf
  40.  
  41.  PrintN("End of Program.")
  42.  End
  43.  
  44.